<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <el-form :model="ruleForm2" status-icon  ref="ruleForm2" label-width="100px" class="demo-ruleForm">
      <el-form-item label="账号" prop="pass">
        <el-input type="text" v-model="ruleForm2.account" auto-complete="off"></el-input>
      </el-form-item>
      <el-form-item label="密码" prop="checkPass">
        <el-input type="password" v-model="ruleForm2.password" auto-complete="off"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="submit">提交</el-button>
        <el-button type="success" @click="next" >核心</el-button>
        <el-button @click="say">登陆状态测试</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script lang="ts">
import { Component, Vue } from 'vue-property-decorator';
import HelloWorld from '@/components/HelloWorld.vue'; // @ is an alias to /
import {PostInfo} from '@/bean/PostInfo.ts'

@Component({
  components: {
    HelloWorld,
  },
})
export default class Login extends Vue {
  ruleForm2={
        account:'account',
        password:''
      };
  submit():void{
    let info:PostInfo<Object>=new PostInfo('login',{account:this.ruleForm2.account},(data:Object)=>{console.log('xxx')});
    this.$post(info);
  }
  say():void{
    let info:PostInfo<Object>=new PostInfo('say',{account:this.ruleForm2.account},(data:Object)=>{console.log(data)});
    this.$post(info);
  }
  next():void{
    this.$store.commit('setShowHome',false)
    this.$router.push({ path: '/main'})
  }
}
</script>
